﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Module_NewsManage.ascx.cs" Inherits="Modules_Module_NewsManage" %>

<asp:MultiView ID="MultiView_NewsManage" runat="server">
    <asp:View ID="View_PostNews" runat="server">
        发布新闻<br />
        标题<asp:TextBox ID="TextBox_Title" runat="server"></asp:TextBox>
        <br />
        内容<asp:TextBox ID="TextBox_Context" runat="server" Rows="10" 
            TextMode="MultiLine"></asp:TextBox>
        <br />
        置顶<asp:CheckBox ID="CheckBox_Top" runat="server" />
        <br />
        <asp:Button ID="Button_NewsSubmit" runat="server" 
            onclick="Button_NewsSubmit_Click" Text="提交" />
    </asp:View>
    <asp:View ID="View_ModifyNews" runat="server">
    <asp:Button ID="AsPostNew" runat="server" Text="发布新闻" onclick="AsPostNew_Click" />
    <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
            onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing" 
          DataKeyNames="id" onrowupdating="GridView1_RowUpdating" 
            onrowcancelingedit="GridView1_RowCancelingEdit">
            <Columns>
                <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                <%# Container.DataItemIndex + 1%> 
                </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="title" HeaderText="标题" />
                <asp:BoundField DataField="message" HeaderText="内容" />
                <asp:BoundField DataField="publishtime" HeaderText="发布时间" 
                    DataFormatString="{0:yyyy-MM-dd HH:mm:ss }" />
                <asp:TemplateField HeaderText="置顶">
                <ItemTemplate>
                    <asp:CheckBox ID="checkistop" runat="server" Checked='<%# DataBinder.Eval(Container.DataItem,"isTop").ToString()=="1"?true:false %>' Enabled="false" />
                </ItemTemplate>         
                </asp:TemplateField>
                <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
                <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
            </Columns>
        </asp:GridView>     
                    
    </asp:View>
</asp:MultiView>
